<?php
    header('Access-Control-Allow-Origin: *');
    header('Content-Type:text/html;charset=utf-8');
    $con = mysqli_connect("127.0.0.1", "root", "root", "mydb");
    $uId = $_GET['uId'];
    $classId = $_GET['classId'];
    $create_at = $_GET['create_at'];
    $sql = "SELECT * FROM lesson_sign WHERE l_id = '$classId' AND s_id = '$uId' AND create_at = '$create_at';";
    $res = mysqli_query($con,$sql);
    if($result = mysqli_fetch_row($res)){
        echo 'repeat';
    }else{
        $sql1 = "INSERT INTO lesson_sign (l_id,s_id,create_at) VALUES($classId,$uId,'$create_at');";
        $res1 = mysqli_query($con,$sql1);
        echo 'ok';
    }
    mysqli_close($con);
?>